﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Microsoft Corp." file="GetStorageAccountKeysCommand.cs">
//   All rights reserved. See License.txt in the project root for license information.
// </copyright>
// 
// --------------------------------------------------------------------------------------------------------------------
namespace AzureManagement.AzureCommands
{
    using System;

    using RestClient;

    public class GetStorageAccountKeysCommand : AzureManagementCommand
    {
        private readonly string serviceName;

        public GetStorageAccountKeysCommand(IAzureServiceContext serviceContext, string serviceName)
            : base(serviceContext)
        {
            if (string.IsNullOrEmpty(serviceName))
            {
                throw new ArgumentException("Service name must not be null or empty.", "serviceName");
            }

            this.serviceName = serviceName;
        }

        protected override RequestContext GetRequestContext()
        {
            return this.CreateGetOperationRequestContext();
        }

        protected override string FormatPath(IAzureServiceContext azureServiceContext)
        {
            return string.Format(
                "{0}/services/storageservices/{1}/keys", azureServiceContext.SubscriptionId, this.serviceName);
        }
    }
}